package com.log.blog_backend.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.log.blog_backend.utils.ListToVarcharTypeHandler;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;



import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("articles")
public class Article implements Serializable {
    @TableId
    private String articleId ;

    private String userId;

    private String title;

    private String summarize;

    private String cover;

    @TableField(typeHandler = ListToVarcharTypeHandler.class)
    private List<String> tags;
//    private String tags;
    @TableLogic
    private Integer status;

    private Integer sendwho;

    private String content;

    private Integer isrelease;

    //创建时间
    @TableField(fill = FieldFill.INSERT )
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    //修改时间
    private Date updateTime;

}
